<!--
报告管理-报告管理查看
 add by yyp 2020-01-12
-->
<template lang="pug">
  kalix-dialog.user-add(title='查看' bizKey="Report" ref="kalixBizDialog"  v-bind:submitBefore="submitBefore"  v-bind:formModel.sync="formModel" isView)
    div.el-form(slot="dialogFormSlot")
      template(slot="tableColumnSlot")
      el-form-item(label="患者姓名" prop="name" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.name" readonly)
      el-form-item(label="病患年龄" prop="age" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.age" readonly)
      el-form-item(label="病患性别" prop="sex" v-bind:label-width="labelWidth" )
        el-radio(v-model="sse" label="1" readonly disabled) 男
        el-radio(v-model="sse" label="2" readonly disabled) 女
      el-form-item(label="原切片单位" prop="unit" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.unit" readonly)
      el-form-item(label="档案分类" prop="className" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.className" readonly)
      el-form-item(label="病历号" prop="pathologyNum" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.pathologyNum" readonly)
      el-form-item(label="申请医师" prop="doctor" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.doctor" readonly)
      el-form-item(label="临床诊断" prop="diagnosis" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.diagnosis" type="textarea" readonly)
      el-form-item(label="详细临床诊断" prop="diagnosisDetail" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.diagnosisDetail" type="textarea" readonly)
      el-form-item(label="打印状态" prop="status" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.status" readonly)
      el-form-item(label="申请时间" prop="applicationTime"  v-bind:label-width="labelWidth"  align="center")
        el-input(v-model="formModel.applicationTime" readonly)
      el-form-item(label="会诊医院" prop="hospitalNameExpert" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.hospitalNameExpert" readonly)
      el-form-item(label="会诊专家" prop="expertName" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.expertName" readonly)
      el-form-item(label="会诊日期" prop="date"  v-bind:label-width="labelWidth"  align="center")
        el-input(v-model="formModel.date" readonly)
      el-form-item(label="会诊号" prop="number" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.number" readonly)
      el-form-item(label="光镜所见" prop="picture" v-bind:label-width="labelWidth" )
        kalix-img-upload.img-margin(v-model="formModel.picture" readonly="readonly")
      el-form-item(label="会诊意见" prop="opinion" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.opinion" type="textarea" readonly)
      <!--el-form-item(label="申请修改报告" prop="statusOn" v-bind:label-width="labelWidth" )-->
        <!--el-input(v-model="formModel.statusOn" readonly)-->
      el-form-item.short(label="录制视频" prop="videoUrl" v-bind:label-width="labelWidth")
      vue-player(:src="videoUrl" v-show="videoUrl === null ? false : (videoUrl === ' ' ? false : true)" style="margin-bottom: 22px;")
</template>

<script type="text/ecmascript-6">
  import FormModel from './model'
  import KalixClansmanUpload from '../../../../../components/fileUpload/upload'
  import {baseURL} from '../../../../../config/global.toml'
  import KalixSelect from '../../../../../components/corelib/components/common/baseSelect'
  import VuePlayer from '../../../../../components/corelib/components/common/vue-player.vue'
  import KalixImgUpload from '../../../../../components/corelib/components/common/imgUpload'
  export default {
    name: 'reportView',
    components: {
      KalixSelect,
      KalixClansmanUpload,
      VuePlayer,
      KalixImgUpload
    },
    data() {
      return {
        sse: null,
        action: baseURL + '/camel/rest/upload',
        formModel: Object.assign({}, FormModel),
        labelWidth: '130px',
        videoUrl: null,
        fileList: [],
        filePathArr: []
        // date2: null,
        // date3: null
      }
    },
    mounted() {
      // console.log('sse', this.sse)
    },
    methods: {
      getFilePathVideo(filePath, fileName) { // 视频上传路径
        this.formModel.videoUrl = filePath
        this.videoUrl = filePath
      },
      init(dialogOption) {
        console.log('---------dialogOption------------', dialogOption)
        if (this.formModel.videoUrl !== null && this.formModel.videoUrl !== '') {
          this.videoUrl = this.formModel.videoUrl
        }
        if (this.formModel.sexZ === '2') {
          this.sse = '2'
        } else {
          this.sse = '1'
        }
        console.log('sse', this.sse)
      },
      submitBefore(baseDialog, callBack) {
        let filePath = ''
        if (this.filePathArr.length > 0) {
          this.filePathArr.forEach(e => {
            filePath += e + ','
          })
          filePath = filePath.substr(0, filePath.length - 1)
        }
        console.log('filePath==========', filePath)
        baseDialog.formModel.curriculumFile = filePath
        callBack()
      }
    }
  }
</script>

<style scoped lang="stylus" type="text/stylus">
  .el-form
    width 50%
    margin auto
    .radio
      margin-left 150px
      margin-bottom 20px
      .el-radio
        color: #3465cb
        font-weight: bold
        font-size: 14px
  .img-margin
    margin-left 150px
</style>
